export const debunce = (fn, delay) => {
  let timer = null;
  return function () {
    timer && clearTimeout(timer);
    const arg = arguments;
    timer = setTimeout(() => {
      fn.call(this, ...arg);
      clearTimeout(timer);
    }, delay);
  };
};
